#ifndef FUNCTIONS_H_
#define FUNCTIONS_H_

#include <fstream>

#include "types.h"

//using namespace std;

void OpenFileFailed(const char *);						// failed to open file, print error information
void formFilename(char **, const char *,const char *);	// generate outfile name based on infile name
char GetChar();											// get a char

void hexstr2uint64(const char *, uint64 *);				// convert a char array(hex) to an unsigned int64 number
void uint642hexstr(const uint64, char *);				// convert an unsigned int64 number to a char array(hex)
void readlocs(ClkLocList *, const char *);				// read all location iterms into a list
int binsearch(const uint64, const ClkLocList *);		// use queryID to find the query's first click in click file
														// by bin-searching the location iterm in the location list 

bool locateClickFile(const char *);
void locateClicks();
bool statClickFile(const char *);
void statClicks();
void scoreQueryFile(const char *, const char *, const char *);
void scoreQF();
void scoreClickFile(const char *, const char *);
void scoreCF();

#endif /*FUNCTIONS_H_*/
